<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html class="no-js" lang="en">

<head>
    <jsp:include page="../commons/top.jsp"/>
    <title>全部商品 : ${cateName}</title>

    <style>
        pagination .prev {
            position: relative;
            right: 23px;
        }
        pagination .next {
            position: relative;
            left: 23px;
        }
    </style>
</head>

<body>

<!--头部区域开始-->
    <jsp:include page="../commons/head.jsp"/>
<!--头部区域结束-->

<!--导航区域开始-->
    <div class="breadcrumbs_area">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <div class="breadcrumb_content">
                        <ul>
                            <li><a href="${pageContext.request.contextPath}/">首页</a></li>
                            <li>商品列表</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
<!--导航区域结束-->

<!--商品列表开始-->
    <div class="shop_area shop_fullwidth">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <!--工具栏开始-->
                    <div class="shop_toolbar_wrapper">
                        <div class="shop_toolbar_btn">
                            <button data-role="grid_4" type="button"  class=" active btn-grid-4" data-toggle="tooltip" title="4"></button>
                            <button data-role="grid_list" type="button"  class="btn-list" data-toggle="tooltip" title="List"></button>
                        </div>
                        <div class=" niceselect_option">
                            <form class="select_option" action="#">
                                <select name="orderby" id="short">

                                    <option selected value="1">按人气排序</option>
                                    <option  value="2">按平均评分排序</option>
                                    <option value="3">按新旧程度排序</option>
                                    <option value="4">按价格排序: 低到高</option>
                                    <option value="5">按价格排序: 高到低</option>
                                    <option value="6">那商品名称: </option>
                                </select>
                            </form>
                        </div>
                    </div>
                    <!--工具栏结束-->

                    <!--shop wrapper start-->
                    <div class="row no-gutters shop_wrapper">
                        <c:forEach var="goodsList" items="${page.list}">
                            <div class="col-lg-3 col-md-4 col-12 ">
                                <article class="single_product">
                                    <figure>
                                        <div class="product_thumb">
                                            <a class="primary_img" href="${pageContext.servletContext.contextPath}/index/system_detailed/${goodsList.goodsId}"  target="_blank"><img src="${pageContext.request.contextPath}/images/${goodsList.image1}" alt="" target="_blank"></a>
                                            <a class="secondary_img" href="${pageContext.servletContext.contextPath}/index/system_detailed/${goodsList.goodsId}"  target="_blank"><img src="${pageContext.request.contextPath}/images/${goodsList.image2}" alt="" target="_blank"></a>
                                            <div class="label_product">
                                                <span class="label_sale">热卖</span>
                                            </div>
                                            <div class="action_links">
                                            </div>
                                        </div>

                                        <div class="product_content grid_content">
                                            <div class="product_content_inner">
                                                <h4 class="product_name"><a href="${pageContext.servletContext.contextPath}/index/system_detailed/${goodsList.goodsId}"  target="_blank">${goodsList.goodsName}</a></h4>
                                                <div class="product_rating">
                                                </div>
                                                <div class="price_box">
                                                    <c:forEach var="gs" items="${goodsList.specs}">
                                                        <span class="current_price">￥${gs.specsPrice}</span>
                                                    </c:forEach>
                                                </div>
                                            </div>
                                            <div class="add_to_cart">
                                                <a href="${pageContext.servletContext.contextPath}/index/cart" title="添加到购物车"  target="_blank">添加到购物车</a>
                                            </div>
                                        </div>
                                        <div class="product_content list_content">
                                            <h4 class="product_name"><a href="${pageContext.servletContext.contextPath}/index/system_detailed/${goodsList.goodsId}"  target="_blank">${goodsList.goodsName}</a></h4>
                                            <div class="product_rating">
                                            </div>
                                            <div class="price_box">
                                                <c:forEach var="gs" items="${goodsList.specs}">
                                                    <span class="current_price">￥${gs.specsPrice}</span>
                                                </c:forEach>
                                            </div>
                                            <div class="product_desc">
                                                <p>${goodsList.describe}</p>
                                            </div>
                                            <div class="add_to_cart">
                                                <a href="${pageContext.servletContext.contextPath}/index/cart" title="添加到购物车"  target="_blank">添加到购物车</a>
                                            </div>
                                            <div class="action_links">
                                                <ul>
                                                    <li class="wishlist "><a href="wishlist.html"  title="加入愿望清单"><i class="ion-android-favorite-outline"></i>  加入愿望清单</a></li>
                                                </ul>
                                            </div>
                                        </div>
                                    </figure>
                                </article>
                            </div>
                        </c:forEach>
                    </div>

                    <div class="shop_toolbar t_bottom">
                        <div class="pagination">
                            <ul>
                                <c:choose>
                                    <c:when test="${page.isFirstPage == true}">
                                        <li class="disabled" style="width: 75px"><span>上一页</span></li>
                                    </c:when>
                                    <c:otherwise>
                                        <li class="prev" style="width: 75px"><a href="${pageContext.servletContext.contextPath}/index/list?goodsname=${param.goodsName}&id=${id}&currentPageNo=${page.prePage}">上一页</a></li>
                                    </c:otherwise>
                                </c:choose>

                                <c:forEach var="pageNo" items="${page.navigatepageNums}">
                                    <c:choose>
                                        <c:when test="${pageNo == page.pageNum}">
                                            <li class="disabled">${pageNo}</li>
                                        </c:when>
                                        <c:otherwise>
                                            <li class="current"><a href="${pageContext.servletContext.contextPath}/index/list?goodsname=${param.goodsName}&id=${id}&currentPageNo=${pageNo}" class="tcdNumber">${pageNo}</a></li>

                                        </c:otherwise>
                                    </c:choose>
                                </c:forEach>

                                <c:choose>
                                    <c:when test="${page.isLastPage == true}">
                                        <li class="disabled" style="width: 75px"><span>下一页</span></li>
                                    </c:when>
                                    <c:otherwise>
                                        <li class="next" style="width: 75px"><a href="${pageContext.servletContext.contextPath}/index/list?goodsname=${param.goodsName}&id=${id}&currentPageNo=${page.nextPage}">下一页</a></li>
                                    </c:otherwise>
                                </c:choose>

                            </ul>
                        </div>
                    </div>
                    <!--shop toolbar end-->
                    <!--shop wrapper end-->
                </div>
            </div>
        </div>
    </div>
<!--商品列表结束-->

<!--footer area start-->
<jsp:include page="../commons/bottom.jsp"/>
<!--footer area end-->

</body>
</html>